///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Dec 21 2009)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////

#include "ColorBand.h"

#include "MainWindow_Base.h"

///////////////////////////////////////////////////////////////////////////

MainWindow_Base::MainWindow_Base( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	
	wxBoxSizer* bSizer1;
	bSizer1 = new wxBoxSizer( wxHORIZONTAL );
	
	control_panel = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	control_panel->Enable( false );
	control_panel->SetMinSize( wxSize( 240,-1 ) );
	
	wxBoxSizer* bSizer3;
	bSizer3 = new wxBoxSizer( wxVERTICAL );
	
	wxStaticBoxSizer* sbSizer1;
	sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( control_panel, wxID_ANY, wxT("Threshold") ), wxVERTICAL );
	
	m_panel31 = new ColorBand( control_panel, wxID_ANY, wxDefaultPosition, wxSize( 225,-1 ), wxTAB_TRAVERSAL );
	m_panel31->SetMinSize( wxSize( 225,-1 ) );
	m_panel31->SetMaxSize( wxSize( 225,-1 ) );
	
	wxBoxSizer* bSizer131;
	bSizer131 = new wxBoxSizer( wxVERTICAL );
	
	threshold_slider = new wxSlider( m_panel31, wxID_ANY, 500, 0, 1000, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL );
	bSizer131->Add( threshold_slider, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 );
	
	m_panel31->SetSizer( bSizer131 );
	m_panel31->Layout();
	sbSizer1->Add( m_panel31, 1, wxEXPAND | wxALL, 0 );
	
	bSizer3->Add( sbSizer1, 0, wxEXPAND, 5 );
	
	wxStaticBoxSizer* sbSizer10;
	sbSizer10 = new wxStaticBoxSizer( new wxStaticBox( control_panel, wxID_ANY, wxT("Resolution") ), wxHORIZONTAL );
	
	xRes_textCtrl = new wxTextCtrl( control_panel, wxID_ANY, wxT("10"), wxDefaultPosition, wxSize( 60,-1 ), 0 );
	sbSizer10->Add( xRes_textCtrl, 0, wxALL, 5 );
	
	yRes_textCtrl = new wxTextCtrl( control_panel, wxID_ANY, wxT("10"), wxDefaultPosition, wxSize( 60,-1 ), 0 );
	sbSizer10->Add( yRes_textCtrl, 0, wxALL, 5 );
	
	zRes_textCtrl = new wxTextCtrl( control_panel, wxID_ANY, wxT("10"), wxDefaultPosition, wxSize( 60,-1 ), 0 );
	sbSizer10->Add( zRes_textCtrl, 0, wxALL, 5 );
	
	bSizer3->Add( sbSizer10, 0, wxEXPAND, 5 );
	
	wxStaticBoxSizer* sbSizer2;
	sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( control_panel, wxID_ANY, wxT("Surface Generation") ), wxVERTICAL );
	
	generate_button = new wxButton( control_panel, wxID_ANY, wxT("Generate"), wxDefaultPosition, wxDefaultSize, 0 );
	sbSizer2->Add( generate_button, 0, wxALL, 5 );
	
	selfGen_checkBox = new wxCheckBox( control_panel, wxID_ANY, wxT("Self Generation"), wxDefaultPosition, wxDefaultSize, 0 );
	sbSizer2->Add( selfGen_checkBox, 0, wxALL, 5 );
	
	bSizer3->Add( sbSizer2, 0, wxEXPAND, 5 );
	
	control_panel->SetSizer( bSizer3 );
	control_panel->Layout();
	bSizer3->Fit( control_panel );
	bSizer1->Add( control_panel, 0, wxEXPAND | wxALL, 5 );
	
	m_panel3 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxBoxSizer* bSizer4;
	bSizer4 = new wxBoxSizer( wxVERTICAL );
	
	int atributos[] = {WX_GL_RGBA, WX_GL_DOUBLEBUFFER, WX_GL_DEPTH_SIZE, 16, 0};
	glCanvas = new GLPane(m_panel3,10,wxDefaultPosition,wxDefaultSize, 0,_T("ID_CUSTOM1"), atributos);
	bSizer4->Add( glCanvas, 1, wxALL|wxEXPAND, 5 );
	
	m_panel14 = new wxPanel( m_panel3, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxBoxSizer* bSizer13;
	bSizer13 = new wxBoxSizer( wxHORIZONTAL );
	
	wxString drawMode_choiceChoices[] = { wxT("Solid"), wxT("Wireframe") };
	int drawMode_choiceNChoices = sizeof( drawMode_choiceChoices ) / sizeof( wxString );
	drawMode_choice = new wxChoice( m_panel14, drawMode_choice_ID, wxDefaultPosition, wxDefaultSize, drawMode_choiceNChoices, drawMode_choiceChoices, 0 );
	drawMode_choice->SetSelection( 0 );
	bSizer13->Add( drawMode_choice, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	showGrid_checkBox = new wxCheckBox( m_panel14, wxID_ANY, wxT("Show Grid"), wxDefaultPosition, wxDefaultSize, 0 );
	showGrid_checkBox->SetValue(true); 
	bSizer13->Add( showGrid_checkBox, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	m_panel14->SetSizer( bSizer13 );
	m_panel14->Layout();
	bSizer13->Fit( m_panel14 );
	bSizer4->Add( m_panel14, 0, wxEXPAND|wxALL, 0 );
	
	m_panel3->SetSizer( bSizer4 );
	m_panel3->Layout();
	bSizer4->Fit( m_panel3 );
	bSizer1->Add( m_panel3, 1, wxEXPAND | wxALL, 5 );
	
	this->SetSizer( bSizer1 );
	this->Layout();
	m_menubar1 = new wxMenuBar( 0 );
	file_menu = new wxMenu();
	wxMenuItem* new_menuItem;
	new_menuItem = new wxMenuItem( file_menu, wxID_NEW, wxString( wxT("&New") ) , wxEmptyString, wxITEM_NORMAL );
	file_menu->Append( new_menuItem );
	
	m_menu1 = new wxMenu();
	wxMenuItem* ctData_menuItem;
	ctData_menuItem = new wxMenuItem( m_menu1, wxID_ANY, wxString( wxT("CT") ) , wxEmptyString, wxITEM_NORMAL );
	m_menu1->Append( ctData_menuItem );
	
	file_menu->Append( -1, wxT("Import"), m_menu1 );
	
	m_menubar1->Append( file_menu, wxT("&File") );
	
	primitives_menu = new wxMenu();
	wxMenuItem* sphere_menuItem;
	sphere_menuItem = new wxMenuItem( primitives_menu, wxID_ANY, wxString( wxT("Sphere") ) , wxEmptyString, wxITEM_NORMAL );
	primitives_menu->Append( sphere_menuItem );
	
	wxMenuItem* random_menuItem;
	random_menuItem = new wxMenuItem( primitives_menu, wxID_ANY, wxString( wxT("Random") ) , wxEmptyString, wxITEM_NORMAL );
	primitives_menu->Append( random_menuItem );
	
	m_menubar1->Append( primitives_menu, wxT("&Primitives") );
	
	help_menu = new wxMenu();
	wxMenuItem* about_menuItem;
	about_menuItem = new wxMenuItem( help_menu, wxID_ABOUT, wxString( wxT("About") ) , wxEmptyString, wxITEM_NORMAL );
	help_menu->Append( about_menuItem );
	
	m_menubar1->Append( help_menu, wxT("&Help") );
	
	this->SetMenuBar( m_menubar1 );
	
	statusBar = this->CreateStatusBar( 1, wxST_SIZEGRIP, wxID_ANY );
	
	// Connect Events
	threshold_slider->Connect( wxEVT_SCROLL_TOP, wxScrollEventHandler( MainWindow_Base::onThresholdScroll ), NULL, this );
	threshold_slider->Connect( wxEVT_SCROLL_BOTTOM, wxScrollEventHandler( MainWindow_Base::onThresholdScroll ), NULL, this );
	threshold_slider->Connect( wxEVT_SCROLL_LINEUP, wxScrollEventHandler( MainWindow_Base::onThresholdScroll ), NULL, this );
	threshold_slider->Connect( wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler( MainWindow_Base::onThresholdScroll ), NULL, this );
	threshold_slider->Connect( wxEVT_SCROLL_PAGEUP, wxScrollEventHandler( MainWindow_Base::onThresholdScroll ), NULL, this );
	threshold_slider->Connect( wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler( MainWindow_Base::onThresholdScroll ), NULL, this );
	threshold_slider->Connect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( MainWindow_Base::onThresholdScroll ), NULL, this );
	threshold_slider->Connect( wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler( MainWindow_Base::onThresholdScroll ), NULL, this );
	threshold_slider->Connect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( MainWindow_Base::onThresholdScroll ), NULL, this );
	generate_button->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainWindow_Base::onGenerateButton ), NULL, this );
	drawMode_choice->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( MainWindow_Base::changeDrawMode ), NULL, this );
	showGrid_checkBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( MainWindow_Base::onShowGrid ), NULL, this );
	this->Connect( new_menuItem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainWindow_Base::onNewMenu ) );
	this->Connect( ctData_menuItem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainWindow_Base::onImportMenu ) );
	this->Connect( sphere_menuItem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainWindow_Base::addPrimitive ) );
	this->Connect( random_menuItem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainWindow_Base::addPrimitive ) );
	this->Connect( about_menuItem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainWindow_Base::onAboutMenu ) );
}

MainWindow_Base::~MainWindow_Base()
{
	// Disconnect Events
	threshold_slider->Disconnect( wxEVT_SCROLL_TOP, wxScrollEventHandler( MainWindow_Base::onThresholdScroll ), NULL, this );
	threshold_slider->Disconnect( wxEVT_SCROLL_BOTTOM, wxScrollEventHandler( MainWindow_Base::onThresholdScroll ), NULL, this );
	threshold_slider->Disconnect( wxEVT_SCROLL_LINEUP, wxScrollEventHandler( MainWindow_Base::onThresholdScroll ), NULL, this );
	threshold_slider->Disconnect( wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler( MainWindow_Base::onThresholdScroll ), NULL, this );
	threshold_slider->Disconnect( wxEVT_SCROLL_PAGEUP, wxScrollEventHandler( MainWindow_Base::onThresholdScroll ), NULL, this );
	threshold_slider->Disconnect( wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler( MainWindow_Base::onThresholdScroll ), NULL, this );
	threshold_slider->Disconnect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( MainWindow_Base::onThresholdScroll ), NULL, this );
	threshold_slider->Disconnect( wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler( MainWindow_Base::onThresholdScroll ), NULL, this );
	threshold_slider->Disconnect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( MainWindow_Base::onThresholdScroll ), NULL, this );
	generate_button->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainWindow_Base::onGenerateButton ), NULL, this );
	drawMode_choice->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( MainWindow_Base::changeDrawMode ), NULL, this );
	showGrid_checkBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( MainWindow_Base::onShowGrid ), NULL, this );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainWindow_Base::onNewMenu ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainWindow_Base::onImportMenu ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainWindow_Base::addPrimitive ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainWindow_Base::addPrimitive ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainWindow_Base::onAboutMenu ) );
}

Sphere_Dialog_Base::Sphere_Dialog_Base( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	
	wxBoxSizer* bSizer17;
	bSizer17 = new wxBoxSizer( wxVERTICAL );
	
	wxStaticBoxSizer* sbSizer9;
	sbSizer9 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Centre") ), wxHORIZONTAL );
	
	x_textCtrl = new wxTextCtrl( this, wxID_ANY, wxT("0,0"), wxDefaultPosition, wxSize( 60,-1 ), 0 );
	sbSizer9->Add( x_textCtrl, 0, wxALL, 5 );
	
	y_textCtrl = new wxTextCtrl( this, wxID_ANY, wxT("0,0"), wxDefaultPosition, wxSize( 60,-1 ), 0 );
	sbSizer9->Add( y_textCtrl, 0, wxALL, 5 );
	
	z_textCtrl = new wxTextCtrl( this, wxID_ANY, wxT("0,0"), wxDefaultPosition, wxSize( 60,-1 ), 0 );
	sbSizer9->Add( z_textCtrl, 0, wxALL, 5 );
	
	bSizer17->Add( sbSizer9, 1, wxEXPAND, 5 );
	
	wxBoxSizer* bSizer47;
	bSizer47 = new wxBoxSizer( wxHORIZONTAL );
	
	wxStaticBoxSizer* sbSizer10;
	sbSizer10 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Radius") ), wxVERTICAL );
	
	radius_textCtrl = new wxTextCtrl( this, wxID_ANY, wxT("1,0"), wxDefaultPosition, wxSize( 60,-1 ), 0 );
	radius_textCtrl->SetToolTip( wxT("Pontos com distância do centro maior que esse valor terão valor zero.") );
	
	sbSizer10->Add( radius_textCtrl, 0, wxALL, 5 );
	
	bSizer47->Add( sbSizer10, 1, wxEXPAND, 5 );
	
	wxStaticBoxSizer* sbSizer11;
	sbSizer11 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Value at Centre") ), wxVERTICAL );
	
	value_textCtrl = new wxTextCtrl( this, wxID_ANY, wxT("100,0"), wxDefaultPosition, wxSize( 60,-1 ), 0 );
	value_textCtrl->SetToolTip( wxT("O centro da esfera terá esse valor. Conforme se afastamos do centro, o valor decai até ser zero na fronteira.") );
	
	sbSizer11->Add( value_textCtrl, 0, wxALL, 5 );
	
	bSizer47->Add( sbSizer11, 1, wxEXPAND, 5 );
	
	bSizer17->Add( bSizer47, 1, wxEXPAND, 5 );
	
	wxBoxSizer* bSizer20;
	bSizer20 = new wxBoxSizer( wxHORIZONTAL );
	
	cancel_button = new wxButton( this, wxID_CANCEL, wxT("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer20->Add( cancel_button, 0, wxALL, 5 );
	
	ok_button = new wxButton( this, wxID_OK, wxT("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer20->Add( ok_button, 0, wxALL, 5 );
	
	bSizer17->Add( bSizer20, 0, wxALIGN_RIGHT, 5 );
	
	this->SetSizer( bSizer17 );
	this->Layout();
	bSizer17->Fit( this );
	
	// Connect Events
	ok_button->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( Sphere_Dialog_Base::onOK ), NULL, this );
}

Sphere_Dialog_Base::~Sphere_Dialog_Base()
{
	// Disconnect Events
	ok_button->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( Sphere_Dialog_Base::onOK ), NULL, this );
}

Random_Dialog_Base::Random_Dialog_Base( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	
	wxBoxSizer* bSizer17;
	bSizer17 = new wxBoxSizer( wxVERTICAL );
	
	wxStaticBoxSizer* sbSizer3;
	sbSizer3 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Minimum Point") ), wxVERTICAL );
	
	wxBoxSizer* bSizer2221;
	bSizer2221 = new wxBoxSizer( wxHORIZONTAL );
	
	minx_textCtrl = new wxTextCtrl( this, wxID_ANY, wxT("-10,0"), wxDefaultPosition, wxSize( 60,-1 ), 0 );
	bSizer2221->Add( minx_textCtrl, 0, wxALL, 5 );
	
	miny_textCtrl = new wxTextCtrl( this, wxID_ANY, wxT("-10,0"), wxDefaultPosition, wxSize( 60,-1 ), 0 );
	bSizer2221->Add( miny_textCtrl, 0, wxALL, 5 );
	
	minz_textCtrl = new wxTextCtrl( this, wxID_ANY, wxT("-10,0"), wxDefaultPosition, wxSize( 60,-1 ), 0 );
	bSizer2221->Add( minz_textCtrl, 0, wxALL, 5 );
	
	sbSizer3->Add( bSizer2221, 0, 0, 5 );
	
	bSizer17->Add( sbSizer3, 1, wxEXPAND, 5 );
	
	wxStaticBoxSizer* sbSizer4;
	sbSizer4 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Maximum Point") ), wxVERTICAL );
	
	wxBoxSizer* bSizer222;
	bSizer222 = new wxBoxSizer( wxHORIZONTAL );
	
	x_textCtrl = new wxTextCtrl( this, wxID_ANY, wxT("10,0"), wxDefaultPosition, wxSize( 60,-1 ), 0 );
	bSizer222->Add( x_textCtrl, 0, wxALL, 5 );
	
	y_textCtrl = new wxTextCtrl( this, wxID_ANY, wxT("10,0"), wxDefaultPosition, wxSize( 60,-1 ), 0 );
	bSizer222->Add( y_textCtrl, 0, wxALL, 5 );
	
	z_textCtrl = new wxTextCtrl( this, wxID_ANY, wxT("10,0"), wxDefaultPosition, wxSize( 60,-1 ), 0 );
	bSizer222->Add( z_textCtrl, 0, wxALL, 5 );
	
	sbSizer4->Add( bSizer222, 0, 0, 5 );
	
	bSizer17->Add( sbSizer4, 1, wxEXPAND, 5 );
	
	wxBoxSizer* bSizer46;
	bSizer46 = new wxBoxSizer( wxHORIZONTAL );
	
	wxStaticBoxSizer* sbSizer5;
	sbSizer5 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Min Value") ), wxVERTICAL );
	
	minValue_textCtrl = new wxTextCtrl( this, wxID_ANY, wxT("0,0"), wxDefaultPosition, wxSize( 60,-1 ), 0 );
	minValue_textCtrl->SetToolTip( wxT("O centro da esfera terá esse valor. Conforme se afastamos do centro, o valor decai até ser zero na fronteira.") );
	
	sbSizer5->Add( minValue_textCtrl, 0, wxALL, 5 );
	
	bSizer46->Add( sbSizer5, 0, 0, 5 );
	
	
	bSizer46->Add( 0, 0, 1, wxEXPAND, 5 );
	
	wxStaticBoxSizer* sbSizer51;
	sbSizer51 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Min Value") ), wxVERTICAL );
	
	maxValue_textCtrl = new wxTextCtrl( this, wxID_ANY, wxT("100,0"), wxDefaultPosition, wxSize( 60,-1 ), 0 );
	maxValue_textCtrl->SetToolTip( wxT("O centro da esfera terá esse valor. Conforme se afastamos do centro, o valor decai até ser zero na fronteira.") );
	
	sbSizer51->Add( maxValue_textCtrl, 0, wxALL, 5 );
	
	bSizer46->Add( sbSizer51, 0, 0, 5 );
	
	bSizer17->Add( bSizer46, 0, wxEXPAND, 5 );
	
	wxBoxSizer* bSizer20;
	bSizer20 = new wxBoxSizer( wxHORIZONTAL );
	
	cancel_button = new wxButton( this, wxID_CANCEL, wxT("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer20->Add( cancel_button, 0, wxALL, 5 );
	
	ok_button = new wxButton( this, wxID_OK, wxT("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer20->Add( ok_button, 0, wxALL, 5 );
	
	bSizer17->Add( bSizer20, 0, wxALIGN_RIGHT, 5 );
	
	this->SetSizer( bSizer17 );
	this->Layout();
	bSizer17->Fit( this );
	
	// Connect Events
	ok_button->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( Random_Dialog_Base::onOK ), NULL, this );
}

Random_Dialog_Base::~Random_Dialog_Base()
{
	// Disconnect Events
	ok_button->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( Random_Dialog_Base::onOK ), NULL, this );
}
